<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<form action="">
    请输入原密码：<input type="text" name="oldPassword"><br>
    请输入新密码：<input type="text" name="newPassword" id=""><br>
    <input type="submit" value="修改密码">
</form>
<script type="text/javascript" src="js/jquery-1.12.2.min.js"></script>

<script>
    $("form").submit(function () {
        $.ajax({
            type: "post",
            url: "user/changepassword.do",
            data: $("form").serialize(),
            success: function (data) {
                alert(data.info)
            }

        })
        return false;
    })
</script>

</body>
</html>